const userModel = require('../../model/UserModel')

class LoginSer {

    // 登录查询
    async searchUser(data) {
        const user = await userModel.findAll({
            attributes: [
                ['id', 'id'],
                ['user_number', 'userNumber'],
                ['user_name', 'userName'],
                ['user_sex', 'userSex'],
                ['user_role', 'userRole'],
                ['user_blacklist', 'userBlacklist'],
                ['user_introduce', 'userIntroduce'],
                ['user_photo_url', 'userPhotoUrl'],
                ['user_phone', 'userPhone'],
                ['user_email', 'userEmail'],
                ['password', 'password'],
                ['user_background_img', 'userBackgroundImg'],
                ['user_background_music', 'userBackgroundMusic'],
            ],
            where: {
                user_number: data.userNumber,
            }
        });
        return user
    }
}


module.exports = new LoginSer()
